package com.tuanzi.loan.business.service.system;

import java.util.List;

import org.springframework.data.domain.Page;

import com.tuanzi.loan.business.entity.system.SystemUser;
import com.tuanzi.loan.core.service.BaseService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.system.SystemUserSearchRequest;
import com.tuanzi.loan.vo.response.system.SystemUserSearchResponse;

/**
 * @author Ray 2017/09/21
 */
public interface SystemUserService extends BaseService<SystemUser, String> {

	SystemUser findOneByAccount(String account);

	void resetPassword(String userId);

	Page<SystemUserSearchResponse> list(PageSearcher<SystemUserSearchRequest> pageSearcher);

	List<SystemUser> findAllByPartnerId(String partnerId);

	List<SystemUser> findAllByRoleCode(String roleCode);

	void increseRetryTimes(String account);

	SystemUser unlock(String id);

	void updateLastLoginTimeAndResetRetryTimes(String account);

	void changePassword(String oldPassword, String newPassword, String confirmPassword);

	boolean existByAccount(String account);

	String findNameByAccount(String account);

	List<SystemUser> findAllByAccounts(List<String> accounts);

	List<SystemUser> findAllHasEmailSystemUser();

	/**
	 * 用户是否使用默认密码
	 * @return
	 */
	boolean isUseDefaultPassword(String account);

}
